package edu.hnui.shop.exception;

import edu.hnui.shop.commons.ResultCodeEnum;

/**
 * 设置全局的业务异常
 */
public class ShopBusinessException extends RuntimeException {
    private Integer code;


    public ShopBusinessException(ResultCodeEnum resultCode) {
        super(resultCode.getMessage());
        this.code=resultCode.getCode();
    }

    public ShopBusinessException(Integer code ,String message) {
        super(message);
        this.code=code;
    }

    public ShopBusinessException(String message) {
        super(message);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public ShopBusinessException() {
    }



    public ShopBusinessException(String message, Throwable cause) {
        super(message, cause);
    }

    public ShopBusinessException(Throwable cause) {
        super(cause);
    }

    public ShopBusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }
}
